package homework.April_14;

import java.util.Random;
import java.util.Scanner;

public class GuessNumber {
    public static void main(String[] args) {
        Random random = new Random();
        System.out.println("请猜(0~100)：");
        int guessnum = random.nextInt(101);
        int count = 0;
        Scanner sc = new Scanner(System.in);

        while (true) {
            int num = sc.nextInt();
            count ++;
            if (guessnum == num) {
                if (count == 1) {
                    System.out.println("你真厉害，一次就猜对了！");
                } else if (count > 1 && count < 5) {
                    System.out.println("你很聪明，猜对了！");
                } else {
                    System.out.println("笨蛋,你猜这么多次！");
                }
                System.out.println("程序结束！");
                break;
            } else if (guessnum < num) {
                System.out.println("太大了");
            } else {
                System.out.println("太小了");
            }
        }

    }
}
